#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 27 09:00:52 2018

@author: chenliheng
"""

# 求一段英文文本中单词数量(不包含标点)
str = "If this is your first time using Python , you should definitely check out" \
"the tutorial on the Internet at http://docs.python.org/3.6/tutorial/."

str = str.replace("/"," ")
str = str.replace(":"," ")
str = str.replace(","," ")
str = str.replace("."," ")
words = str.split(" ")

count = 0
for i in range(len(words)):
    if words[i] != "":
        count += 1
      
print("单词数量:{}".format(count))

#print(list(str))



